<!DOCTYPE html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>订单详情</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="/static/css/font.css">
        <link rel="stylesheet" href="/static/css/xadmin.css">
		<link rel="stylesheet" href="/static/css/table.css">
        <script src="/static/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="/static/js/xadmin.js"></script>
        <script type="text/javascript" src="/static/js/jquery.min.js"></script>
		<script type="text/javascript" src="/static/js/jquery.form.js"></script>
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="x-nav">
          <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
						<!-- <div class="layui-card-header">
							<button class="layui-btn" onclick="javascript:alert('短信通知记录');">短信通知记录</button>
						</div> -->
                        <div class="layui-card-body">
							<form class="layui-form" id="signupForm" action="{:url('shop/order/orderafter')}" method="post">
                            <div class="layui-tab layui-tab-card" style="margin-bottom:15px;">
							  <ul class="order_table">
								<li>退货信息</li>
							  </ul>
							  <div class="layui-tab-content">
                                    <table class="layui-table">
                                        <tr>
                                            <td>退货时间</td>
                                            <td><input type="text" name="time" readonly="readonly" value="{$datetime|date='Y-m-d H:i:s',###}" class="layui-input"></td>
                                            <td>工作人员</td>
                                            <td><input type="text" name="nkname" readonly="readonly" value="{$Think.session.admin.nkname}" class="layui-input"></td>
                                        </tr>
                                        <tr>
                                            <td>客户姓名</td>
                                            <td><input type="text" readonly="readonly" value="{$order.username}" class="layui-input"></td>
                                            <td>客户编号</td>
                                            <td><input type="text" readonly="readonly" value="{$order.user_sn}" class="layui-input"></td>
                                        </tr>
                                        <tr>
                                            <td>联系方式</td>
                                            <td><input type="text" readonly="readonly" value="{$order.phone}" class="layui-input"></td>
                                            <td></td>
                                            <td></td>
                                        </tr>
                                        <tr>
                                            <td>退货产品</td>
                                            <td colspan='3'>
                                                <table class="layui-table layui-form">
                                                  <thead>
                                                      <th>产品名称</th>
                                                      <th>IEMI</th>
                                                      <th>S/N</th>
                                                      <th>合同编号</th>
                                                      <th>数量</th>
                                                      <th>单位</th>
                                                      <th>价格（元）</th>
                                                      <th>售货价类型</th>
                                                  </thead>
                                                  <tbody>
                                                    <tr>
                                                      <td>{$goods.goods_name}</td>
                                                      <td>{$goods.imei}</td>
                                                      <td>{$goods.sn}</td>
                                                      <td>{$goods.contract_sn}</td>
                                                      <td>{$goods.number}</td>
                                                      <td>{$goods.unit}</td>
                                                      {if condition="$goods.price_type eq '0'"}
                                                      <td>{$goods.selling_price}</td>
                                                      <td>零售价</td>
                                                      {else /}
                                                      <td>{$goods.trade_price}</td>
                                                      <td>批发价</td>
                                                      {/if}
                                                    </tr>
                                                  </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>退货原因</td>
                                            <td colspan='3'>
                                                <textarea name="reason" class="layui-textarea"></textarea>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>退货选择</td>
                                            <td colspan='3'>
                                                <input type="radio" name="after_type" value="0" title="退换" checked="">
                                                <input type="radio" name="after_type" value="1" title="退款">
                                            </td>
                                        </tr>
                                    </table>
                                    
                              </div>
                              <div class="layui-tab-content">
                                    <div class="layui-form-item">
                                            <div id="hidden-content">
                                                <input type="hidden" name="id" value="{$goods.order_goods_id}"/>
                                            </div>
                                          <button  class="layui-btn" lay-filter="add" lay-submit="">退货</button>
                                      </div>
                                </div>
							</div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div> 
        <script>
        var flag = true;
        layui.use(['laydate','form','layer'], function () {
            var form = layui.form;
            var layer = layui.layer;
            var laydate = layui.laydate;
             //执行一个laydate实例
            laydate.render({
              elem: '#start', //指定元素
              min:'nowTime',
            });
            //监听提交
            form.on('submit(add)',
            function(data) {
                if(flag)
                {
                    flag = false;
                    console.log(1111111111);
                    $("#signupForm").ajaxSubmit(function (message) {
                        console.log(message);
                         if(message.code == 10001)
                         {
                            layer.msg("增加成功", {
                                icon: 6
                            },
                            function() {
                                //关闭当前frame
                                xadmin.close();
                                // 可以对父窗口进行刷新 
                                xadmin.father_reload();
                            });
                         }else{
                            layer.msg(message.msg, {
                                icon: 5
                            },
                            function() {
                                //关闭当前frame
                                xadmin.close();
                                // 可以对父窗口进行刷新 
                                xadmin.father_reload();
                            });
                         }
                    });
                }else{
                    layer.msg('正在提交。。。', {icon: 6});
                }
                return false;
            });
            
            form.on('radio(radio)', function (data) {
                form.render();
            });
            
        });
        </script>
    </body>
</html>